namespace hjc {

	export type LaunchOptions = {
		configs: GameConfigs,
		loading?: hjc.Loading,
		ecs?: boolean,//启用ESC框架
		// http?: THttp,		
		ws?: WSConfigs,
		Proxies?: Array<new () => Proxy>,
		Controllers?: Array<new () => Controller>,
		Systems?: Array<new () => System>,
		Mediators?: Array<new () => Mediator>,
	}

	export type GameConfigs = {
		width: number,
		height: number,
		paddingColor?: color,
		showAll?: boolean,
		dev?: boolean,
		test?: boolean,
		ui?: UIConfigs,
		log?: LogConfigs,
	};

	export type UIConfigs = {
		clickedScale?: number,
		clickedAlpha?: number,
		toggledScale?: number,
		toggledAlpha?: number,
		aniDuration?: number,
	};

	export type LogConfigs = {
		newCount?: boolean,
		newCountValve?: number,
	};

	export type dataType = string;
	export type json = string;
	export type Proto = {
		encode(message: Object, writer?: protobuf.Writer): protobuf.Writer;
		decode(reader: (protobuf.Reader | Uint8Array), length?: number): Object;
	}
	export const DataType = {
		JSON: egret.WebSocket.TYPE_STRING,
		PROTOBUF: egret.WebSocket.TYPE_BINARY,
	}

	export enum PBHeadLen {
		BIT8, BIT16, BIT32
	}
	export type WSConfigs = {
		url?: string,
		host?: string,
		port?: number,
		type?: dataType,
		bigEndian?: boolean,
		pbHeadLen?: PBHeadLen,		//protobuff头长
		protos?: Proto[],			//消息序列
		autoReconnect?: boolean,
		reconnectInterval?: number,
		reconnectTimes?: number,
	}
}
